package com.jiao.utils;


public class RedisKeyUtil {

    private static final String SPLIT = ":";

    public static String getPrefixArticleLiker() {
        return PREFIX_ARTICLE_LIKER + SPLIT;
    }

    //某篇文章的关注者id集合
    private static final String PREFIX_ARTICLE_LIKER = "ArticleLiker";

    //粉丝集合
    private static final String PREFIX_FOLLOWEE_LIST  = "FOLLOWEE";

    //关注集合
    private static final String PREFIX_FOLLOWER_LIST  = "FOLLOWER";

    //文章点赞数
    private static final String PREFIX_VIEW_COUNT  = "ViewCount";

    /**
     * 文章被赞人员集合的key
     * key ---> ArticleLiker:articleId -> set    (存 userId，或删除)
     */
    public static String getArticleLikerKey(Long articleId) {
        return PREFIX_ARTICLE_LIKER + SPLIT + articleId;
    }

    /**
     * 粉丝集合Key
     */
    public static String getFolloweeListKey(Long sysUserId) {
        return PREFIX_FOLLOWEE_LIST + SPLIT + sysUserId;
    }
    /**
     * 关注集合Key
     */
    public static String getFollowerListKey(Long sysUserId) {
        return PREFIX_FOLLOWER_LIST + SPLIT + sysUserId;
    }
    /**
     * 文章点赞数Key
     */
    public static String getViewCountKey(Long articleId) {
        return PREFIX_VIEW_COUNT + SPLIT + articleId;
    }
}
